package org.cainiao.basic.concurrent.juc.aqs.semaphore;

import java.util.concurrent.Semaphore;

/**
 * <br />
 * <p>
 * Author: Cai Niao(wdhlzd@163.com)<br />
 */
public class SemaphoreTest {

    public static void main(String[] args) {
        Semaphore semaphore = new Semaphore(2, true);

        SemaphoreRunnable.newThread("T1", 3, semaphore).start();
        SemaphoreRunnable.newThread("T2", 3, semaphore).start();
        SemaphoreRunnable.newThread("T3", 3, semaphore).start();
        SemaphoreRunnable.newThread("T4", 3, semaphore).start();
    }
}
